home *** CD-ROM | disk | FTP | other *** search
- @echo off
- REM ***************************************************************
- REM *** ControlC.bat - Demonstrate control-C handling using the ***
- REM *** ver.1 ControlC.lib sample library. ***
- REM ***************************************************************
-
- CEnviD %0.bat
- GOTO CENVI_EXIT
-
- #include <ControlC.lib>
-
- printf("Installing CTRL-C/CTRL-BREAK handler...");
- InstallBreakHandler();
- printf("\nPress any key to display, including Ctrl-C or Ctrl-Break.");
- printf("\nExit by pressing ESCAPE...");
- for( ; ; ) {
- if ( gCtrlBreak ) {
- printf("\nCONTRL-C OR CTRL-BREAK WERE PRESSED!!!!!\n");
- gCtrlBreak = False;
- } else if ( kbhit() ) {
- printf("%c",key=getch());
- if ( key == '\033' )
- break;
- }
- }
- RemoveBreakHandler();
-
- :CENVI_EXIT